
#include <BSliderConstraint>
#include "member_BSliderConstraint.h"

using namespace BWE;

#define member						(*(member_BSliderConstraint*)_ptr)
#define member_allocate()			_ptr = new member_BSliderConstraint(this)
#define member_release()			delete (member_BSliderConstraint*)_ptr

BSliderConstraint::BSliderConstraint()
{
	member_allocate();
}
BSliderConstraint::BSliderConstraint(const BString& name) : BConstraint(name)
{
	member_allocate();
}
BSliderConstraint::BSliderConstraint(BNode* nodeA, const BVector& pointA) : BConstraint(nodeA, pointA)
{
	member_allocate();
}
BSliderConstraint::BSliderConstraint(BNode* nodeA, BNode* nodeB) : BConstraint(nodeA, nodeB)
{
	member_allocate();
}
BSliderConstraint::BSliderConstraint(BNode* nodeA, const BVector& pointA, BNode* nodeB, const BVector& pointB) : BConstraint(nodeA, pointA, nodeB, pointB)
{
	member_allocate();
}
BSliderConstraint::~BSliderConstraint()
{
	member_release();
}

void BSliderConstraint::setAxisA(const BVector& axisA)
{
	if (member.axisA != axisA)
	{
		member.axisA = axisA;
		this->emit(Signal_Changed);
	}
}
const BVector& BSliderConstraint::axisA() const
{
	return member.axisA;
}

void BSliderConstraint::setAxisB(const BVector& axisB)
{
	if (member.axisB != axisB)
	{
		member.axisB = axisB;
		this->emit(Signal_Changed);
	}
}
const BVector& BSliderConstraint::axisB() const
{
	return member.axisB;
}

void BSliderConstraint::setLinearLimit(BReal lower, BReal upper)
{
	setLinearLimit(BRealRange(lower, upper));
}
void BSliderConstraint::setLinearLimit(const BRealRange& linearLimit)
{
	if (member.linearLimit != linearLimit)
	{
		member.linearLimit = linearLimit;
		this->emit(Signal_Changed);
	}
}
const BRealRange& BSliderConstraint::linearLimit() const
{
	return member.linearLimit;
}

void BSliderConstraint::setAngleLimit(BReal lower, BReal upper)
{
	setAngleLimit(BRealRange(lower, upper));
}
void BSliderConstraint::setAngleLimit(const BRealRange& angleLimit)
{
	if (member.angleLimit != angleLimit)
	{
		member.angleLimit = angleLimit;
		this->emit(Signal_Changed);
	}
}
const BRealRange& BSliderConstraint::angleLimit() const
{
	return member.angleLimit;
}

void BSliderConstraint::solve()
{

}
